package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

@Entity
@Table(name = "l2r_yh_hotel")
@DynamicInsert
public class L2RYhHotel extends BaseEntity {
    private String groupCode;
    private String hotelCode;
    private String hotelName;
    private String hotelAddress;
    private BigDecimal minRoomRate;
    private Integer unuseRmnum;
    private String isLimit;

    @Basic
    @Column(name = "group_code")
    public String getGroupCode() {
        return groupCode;
    }

    public void setGroupCode(String groupCode) {
        this.groupCode = groupCode;
    }

    @Basic
    @Column(name = "hotel_code")
    public String getHotelCode() {
        return hotelCode;
    }

    public void setHotelCode(String hotelCode) {
        this.hotelCode = hotelCode;
    }

    @Basic
    @Column(name = "hotel_name")
    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    @Basic
    @Column(name = "hotel_address")
    public String getHotelAddress() {
        return hotelAddress;
    }

    public void setHotelAddress(String hotelAddress) {
        this.hotelAddress = hotelAddress;
    }

    @Basic
    @Column(name = "min_room_rate")
    public BigDecimal getMinRoomRate() {
        return minRoomRate;
    }

    public void setMinRoomRate(BigDecimal minRoomRate) {
        this.minRoomRate = minRoomRate;
    }

    @Basic
    @Column(name = "unuse_rmnum")
    public Integer getUnuseRmnum() {
        return unuseRmnum;
    }

    public void setUnuseRmnum(Integer unuseRmnum) {
        this.unuseRmnum = unuseRmnum;
    }

    @Basic
    @Column(name = "is_limit")
    public String getIsLimit() {
        return isLimit;
    }

    public void setIsLimit(String isLimit) {
        this.isLimit = isLimit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        L2RYhHotel that = (L2RYhHotel) o;

        if (groupCode != null ? !groupCode.equals(that.groupCode) : that.groupCode != null) return false;
        if (hotelCode != null ? !hotelCode.equals(that.hotelCode) : that.hotelCode != null) return false;
        if (hotelName != null ? !hotelName.equals(that.hotelName) : that.hotelName != null) return false;
        if (hotelAddress != null ? !hotelAddress.equals(that.hotelAddress) : that.hotelAddress != null) return false;
        if (minRoomRate != null ? !minRoomRate.equals(that.minRoomRate) : that.minRoomRate != null) return false;
        if (unuseRmnum != null ? !unuseRmnum.equals(that.unuseRmnum) : that.unuseRmnum != null) return false;
        return isLimit != null ? isLimit.equals(that.isLimit) : that.isLimit == null;
    }

    @Override
    public int hashCode() {
        int result = groupCode != null ? groupCode.hashCode() : 0;
        result = 31 * result + (hotelCode != null ? hotelCode.hashCode() : 0);
        result = 31 * result + (hotelName != null ? hotelName.hashCode() : 0);
        result = 31 * result + (hotelAddress != null ? hotelAddress.hashCode() : 0);
        result = 31 * result + (minRoomRate != null ? minRoomRate.hashCode() : 0);
        result = 31 * result + (unuseRmnum != null ? unuseRmnum.hashCode() : 0);
        result = 31 * result + (isLimit != null ? isLimit.hashCode() : 0);
        return result;
    }
}
